
<script>
function ver_barra(image_num)
{ldelim}    
    //alert(document.getElementById("image_"+image_num).value);
	var barra = document.getElementById("image["+image_num+"]").value;
	window.open('{$conf.html}/ver_barra.php?nameBarra='+barra,'ventanita','toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=450,height=400,left=30,top=30');
{rdelim}
</script>

{literal}
<script>
function cambiar(esto)
{
	vista=document.getElementById(esto).style.display;
	if (vista=='none')
		vista='block';
	else
		vista='none';

	document.getElementById(esto).style.display = vista;
}

</script>
{/literal}

		
       <form method="POST" action="{$conf.html}/edit_answer.php" name="qform" enctype="multipart/form-data">
        <input type="hidden" name="aid" value="{$answer.aid}">
	    <input type="hidden" name="qid" value="{$data.qid}">
        <input type="hidden" name="sid" value="{$answer.sid}">
<table width="952" border="0" cellpadding="0" cellspacing="0">

  <!--DWLayoutTable-->
  <tr>
    <td  width="15" height="214" valign="top"    ><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td   width="935" valign="top"><table     width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="935" height="53" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
			 <td colspan="2" align="center" valign="top"  >
			{* SUCCESS MESSAGE *} {section name="success" loop=1 show=$show.success}  
  <div class="message">
              Respuesta editada satisfactoriamente.
            </div>
          {/section}
        {* / SUCCESS MESSAGE *}

        {section name="error" loop=1 show=$show.error}
          <div class="error">{$show.error}</div>
        {/section}
			 </td>
			 </tr>
          <tr>
            <td width="464" height="33" valign="top"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
             
              <tr>
                <td width="464" height="33" valign="top"><strong><a href="javascript:cambiar('tres')">+</a> Tipo
                  de Respuesta</strong>             
				   	<select name="type" size="1">
                     <option value="MS" {$answer.selected.MS}>MS - Multiples Opciones, Una Respuesta</option>
					 <option value="MM" {$answer.selected.MM}>MM - Multiples Opciones, Multiples Respuestas</option>
					 <!--  <option value="T" {$answer.selected.T}>T - Textbox, large</option>
					 <option value="S" {$answer.selected.S}>S - Textbox, small</option>-->
					 <!-- <option value="NUM" {$answer.selected.NUM}>NUM - Numeric Answer</option>
					 <option value="DATE" {$answer.selected.DATE}>DATE - Date/Time Answer</option> -->
					 <!--   <option value="N" {$answer.selected.N}>N - No Answer Values</option>-->
					</select>
					
					</td>
                      </tr>
              <tr>
                <td valign="top">
                  <div id="tres" style="display: none;">
                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                      <!--DWLayoutTable-->
                      <tr>
                        <td width="464" height="120" valign="top">
                          * MS = Multiples opciones, una sola respuesta a escoger.<br />
                          * MM = Multiples opciones, mas de una respuesta a escoger<br /><br />
                          Answer Values (MS and MM Answer Types only) 
                          You must supply a list of possible answers if you selected MS or MM for an Answer Type. 
                          List one answer per text box in the boxes below. Use the button at the bottom of the boxes to add more boxes for more answers. The order you list the answers here is the order they will be presented in the surveys. 
                          You can optionally assign a numeric value to each answer value that you provide, also. This numeric value can then be used when exporting the results to a CSV file for processing by other analysis programs.	 </td>
                              </tr>
                      </table>
                        </div>			
					</td>
                      </tr>
              </table></td>
                  <td width="471">&nbsp;</td>
                </tr>
          <tr>
            <td height="20"></td>
                  <td></td>
                </tr>
          
          </table></td>
          </tr>
      <tr>
        <td height="106" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td height="58" colspan="2" valign="top">
			
			
			
			
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="36" height="24" valign="top" align="center"><strong>Num</strong></td>
                  <td width="273" valign="top" align="center"><strong>Valor de Respuesta (Visualizar)</strong></td>
                  <td width="76" align="center" valign="top"><strong>Valor Numerico</strong></td>
                  <td width="129" align="center" valign="middle"><strong>Imagen de Grafico de Barra </strong></td>
                  <td width="69" valign="top" align="center"><strong>Ver <br />  Barra </strong></td>
                  <td width="248" valign="top"><strong>Imagen
                          de Respuesta. max 20KB-Size 120x50 Solo tipo .gif .jpg
                  .jpeg .png</strong></td>
                  <td colspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
                </tr>
			{section name="i" loop=$answer.num_answers show=TRUE}
			<input type="hidden" name="img_path_answer_actual[{$answer.avid[i]}]" value="{$answer.img_path[i]}">	
            <tr>
               <td height="32" align="center" valign="middle">{$smarty.section.i.iteration}.</td>
                  <td align="center" valign="middle"><input type="text" name="value[{$answer.avid[i]}]" value="{$answer.value[i]}" size="40" maxlength="255" /></td>
                  <td align="center" valign="middle"><input type="text" name="numeric_value[{$answer.avid[i]}]" value="{$answer.numeric_value[i]}" size="10" /></td>
                  <td align="center" valign="middle"><select name="image[{$answer.avid[i]}]" size="1">
                    
                  {section name="img" loop=$answer.allowable_images show=TRUE}
                    
                    <option value="{$answer.allowable_images[img]}"{$answer.image_selected[i][img]}>{$answer.allowable_images[img]}</option>
                    
                  {/section}
                
                  </select>                  </td>
                  <td valign="middle" align="center"><input type="button" name="verBarra" value="Ver" onClick="ver_barra({$answer.avid[i]});" /></td>
                  <td align="center" valign="middle"><input name="Imagen_Answer[]" type="file" size="20" /></td>
                  <td width="39" align="right" valign="top">{if $answer.img_path[i] neq ""}<img src="html_image_a/{$answer.img_path[i]}">{/if}</td>
                  <td width="68" align="left" valign="top">{if $answer.img_path[i] neq ""}<input type="checkbox" name="delete_image[{$answer.avid[i]}]" value="1">Quitar Imagen{/if}</td>
                </tr>
            <tr>
              <td height="0"></td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
            </tr>
            
          {/section}
          
          
          
          
          </table>
			
			</td>
                </tr>
				 {section name="add_answer" loop=1 show=$answer.show_add_answers}
          <tr>
            <td height="30" valign="top">Agregar
              <select name="add_answer_num" size="1">
              <option value="1">1</option>
              <option value="2">2</option>
              <option value="3">3</option>
              <option value="5">5</option>
              <option value="10">10</option>
              <option value="20">20</option>
            </select>
              campo mas para llenar Valores.
            
			  <input type="submit" name="add_answers_submit" value="agregar">
			  <input type="hidden" name="num_answers" value="{$answer.num_answers}">
			  </td>
                  <td width="545"></td>
              </tr>
			   {/section}
          <tr>
            <td height="17"></td>
                <td></td>
              </tr>
          </table></td>
          </tr>
      <tr>
        <td height="26" valign="top" align="center">
		
		<input type="submit" name="submit" value="Editar Respuesta">
		</td>
          </tr>
      <tr>
        <td height="29">&nbsp;</td>
          </tr>
  
    </table></td>
    </tr>

</table>
   </form>